﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Windows;
using Prometheus.Binding.Core;
using Prometheus.TypeUtility;

namespace Prometheus.Binding.GettingStarted
{
    public partial class MainPage
    {
        public MainPage()
        {
            InitializeComponent();
            Loaded+=OnLoaded;
        }

        private void OnLoaded(object sender, RoutedEventArgs routedEventArgs)
        {
            ThreadPool.QueueUserWorkItem(state =>
            {
                Thread.Sleep(5000);
                Dispatcher.BeginInvoke(() =>
                {
                    IEnumerable<proBindingBase> getjBindingByParentIsThis = proForm.GetjBindingByParentIsThis();
                    int count = getjBindingByParentIsThis.Count();
                });
            });
            
        }

        private void update_Time(object sender, RoutedEventArgs e)
        {
            proForm.UpdateTarget("time");
        }

        private void provide_Time(object sender, GenericEventArgs<object> e)
        {
            e.Parameter = DateTime.Now.TimeOfDay.ToString();
        }
    }
}
